import api from '@/common/api.js'

const GetJsdkPackage = async (data, success, fail, isShowLoading = false) => {
	return await api.Request({
		url: '/api/services/app/CommonApi/GetJsdkPackage',
		data: data,
		isObj: true,
		isShowLoading: isShowLoading,
		abpSuccess: success,
		abpFail: fail,
		isNotNeedToken: true,
		isEncrypt: true
	});
};

const GetLocation = async (data,isShowLoading = false) => {
	let result= await api.Request({
		url: '/api/services/app/CommonApi/GetLocation',
		data: data,
		isObj: true,
		isShowLoading: isShowLoading,
		isNotNeedToken: true,
		isEncrypt: true
	});
	return result;
};

const SendCode = async (data,isShowLoading = true) => {
	let result= await api.Request({
		url: '/api/services/app/CommonApi/SendCode',
		data: data,
		isObj: true,
		isShowLoading: isShowLoading,
		isNotNeedToken: true,
		isEncrypt: true
	});
	return result;
};

// 获取微信用户信息
const GetWxAuthorUrl = async (data, success, fail, isShowLoading = true) => {
	const self = this;
	return await api.Request({
		url: '/api/services/app/CommonApi/GetWxAuthorUrl',
		data: data,
		isObj: false,
		isShowLoading: isShowLoading,
		abpSuccess: success,
		abpFail: fail,
		isNotNeedToken:true
	});
};


export default {
	GetLocation,
	GetJsdkPackage,
	SendCode,
	GetWxAuthorUrl
}
